/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DAO;

import org.hibernate.HibernateException;
import org.hibernate.Session;
import pojo.Device;
import ulti.HibernateUtil;

/**
 *
 * @author phong
 */
public class DeviceDAO {
     //<editor-fold defaultstate="collapsed" desc="2. Lấy thông tin Device thông qua id">
    public static Device getDeviceByID(String id) {
        Device device = null;
        Session session = HibernateUtil.getSessionFactory().openSession();
        try {
            device = (Device) session.get(Device.class, id);
        } catch (HibernateException ex) {
            System.err.println(ex);
        }
        return device;
    }
    //</editor-fold>
}
